#include<iostream>
#include<cstring>
#include<queue>
using namespace std;
typedef long long LL;
const int N = 1e5 + 10;
int a[N], b[N];
int n;
int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		b[i] = a[i] - a[i - 1];
	}
	LL p = 0, q = 0;
	for (int i = 2; i <= n; i++) {
		if (b[i])p += b[i];
		else q -= b[i];
	}
	cout << max(p, q) << endl;
	cout << abs(p - q) + 1 << endl;
	return 0;
}